package com.example.mybatis.controller;


import com.example.mybatis.bean.StudentInformation;

import com.example.mybatis.service.StudentInformationService;
import com.example.mybatis.utils.ResultUtil;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("studentInformation")
public class StudentInformationController {
    @Resource
    StudentInformationService studentInformationService;

    @RequestMapping("selectList")
    public ResultUtil selectList(String name,String status){
        return studentInformationService.selectList(name,status);
    }

    @RequestMapping("save")
    public ResultUtil save(StudentInformation studentInformation){
        return studentInformationService.save(studentInformation);
    }

    @RequestMapping("update")
    public ResultUtil update(StudentInformation studentInformation){
        return studentInformationService.update(studentInformation);
    }

    /**
     * 根据id删除
     * @return
     */
    @RequestMapping("removeById")
    public ResultUtil removeById(Long id){
        return studentInformationService.removeById(id);
    }

    @RequestMapping("getById")
    public ResultUtil getById(Long id){
        return studentInformationService.getById(id);
    }



}
